<%@ page import="t_4s.AdminDaolmpl" %>
<%@ page import="t_4s.AdminDao" %>
<%@ page import="t_4s.Admin" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/9/7
  Time: 17:00
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    //拿到请求中携带的数据
    String name=request.getParameter("userName");//拿到姓名
    String pwd=request.getParameter("pwd");//拿到密码
    Admin admin=new Admin(name,pwd);
    //调用后台的登入方法 实现登入
    AdminDao adminDao=new AdminDaolmpl();
    int count=adminDao.login(admin);
    if (count>0){
        request.getRequestDispatcher("zhu.jsp").forward(request,response);
    }else {
        response.sendRedirect("login.jsp");
    }
%>
</body>
</html>
